package com.mzy.SpringApi.AutowiredListOrMap;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/6/14 13:40
 * @Version 1.0
 */
@SpringBootApplication
public class Application {

    /**
     * 在SpringBoot开发中，当一个接口A有多个实现类时，
     * spring会很智能的将bean注入到List<A>或Map<String,A>变量中。
     *
     * @param args
     */
    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(Application.class);
        ApplicationContext context = springApplication.run(args);
        PersonService service = context.getBean(PersonService.class);
        service.echo();
    }

}